home *** CD-ROM | disk | FTP | other *** search
/ MPEG Toolkit / MPEG Toolkit.iso / os2 / mpegenc / src / makefile < prev    next >
Makefile  |  1997-01-01  |  7KB  |  227 lines

  1. # Copyright (c) 1993 The Regents of the University of California.
  2. # All rights reserved.
  3. # Permission to use, copy, modify, and distribute this software and its
  4. # documentation for any purpose, without fee, and without written agreement is
  5. # hereby granted, provided that the above copyright notice and the following
  6. # two paragraphs appear in all copies of this software.
  7. # IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
  8. # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
  9. # OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  10. # CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  11. # THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  12. # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  13. # AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  14. # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  15. # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  16.  
  17. #  
  18. #  $Header: /n/picasso/users/dwallach/vid2/mpeg_encode/RCS/Makefile,v 1.3 1993/01/18 10:20:02 dwallach Exp dwallach $
  19.  
  20. ##############################################################################
  21. #
  22. # Configurable items -- you want to make sure CC points at an ANSI
  23. # compliant C compiler, and that INCLUDE and LIBDIRS specify what's
  24. # necessary for you to include and link against the PBMPLUS libraries.
  25. #
  26. #
  27.  
  28. ################################################################
  29. # PROFILING # use -pg or -p if and only if you want to profile #
  30. ################################################################
  31. PROFLAG =
  32.  
  33. #######################################################
  34. # DEBUGGING # use -g if and only if you want to debug #
  35. #######################################################
  36. DEBUGFLAG =
  37.  
  38. ###############################################################################
  39. # MISSING PROTOTYES # use -DMISSING_PROTOS if your standard headers are wrong #
  40. ###############################################################################
  41. PROTOFLAG = 
  42. #PROTOFLAG = -DMISSING_PROTOS
  43.  
  44. #################################################################
  45. # PBM DIRECTORIES # specify which directories to find pbm stuff #
  46. #################################################################
  47. # directory with libpbm.a, libpgm.a, libppm.a, libpnm.a
  48. PBMLIBDIR = ./pbmplus
  49. # directory with pbm.h, pgm.h, ppm.h, pnm.h
  50. PBMHDRDIR = ./pbmplus
  51.  
  52. ############################################################################
  53. # LIBRARIES # specify library directories; besides pbm, only need math lib #
  54. ############################################################################
  55. LIBDIRS = -L$(PBMLIBDIR)
  56.  
  57. #####################################################################
  58. # COMPILER # specify compiler; should be ANSI-compliant if possible #
  59. #####################################################################
  60. CC = cc
  61.  
  62. ###################################################
  63. # COMPILER FLAGS # modify for different compilers #
  64. ###################################################
  65. # use -DLONG_32 iff
  66. #    1) long's are 32 bits and
  67. #    2) int's are not
  68. #
  69. # if you don't have <netinet/in.h> then you must define one of the following
  70. #    -DFORCE_BIG_ENDIAN
  71. #    -DFORCE_LITTLE_ENDIAN
  72. #
  73. # if you are using a non-ANSI compiler, then use:
  74. #    -DNON_ANSI_COMPILER
  75. #
  76. # one other option:
  77. #    -DHEINOUS_DEBUG_MODE
  78. #
  79. # listed below are some suggested CFLAG lines for various compilers
  80.  
  81. #    gcc
  82. #CFLAGS = $(INCLUDE) -Iheaders -O $(DEBUGFLAG) -Wall -Wmissing-prototypes $(PROFLAG) $(PROTOFLAG)
  83.  
  84. #    SUN cc
  85. #CFLAGS = $(INCLUDE) -Iheaders -O $(DEBUGFLAG) $(PROFLAG) $(PROTOFLAG) -DNON_ANSI_COMPILER
  86.  
  87. #    HP cc
  88. #CFLAGS = $(INCLUDE) -Iheaders -O $(DEBUGFLAG) $(PROFLAG) $(PROTOFLAG) -DNON_ANSI_COMPILER
  89.  
  90. #    DEC ALPHA cc
  91. #CFLAGS = $(INCLUDE) -Iheaders -O -Olimit 1200 $(DEBUGFLAG) $(PROFLAG) $(PROTOFLAG)
  92.  
  93. #     SGI cc
  94. #CFLAGS = $(INCLUDE) -Iheaders -O $(DEBUGFLAG) $(PROFLAG) $(PROTOFLAG) -cckr
  95.  
  96. #    Intel-based SVR4.0 cc
  97. #CFLAGS = $(INCLUDE) -Iheaders -O $(DEBUGFLAG) $(PROFLAG) $(PROTOFLAG) -DLONG_32 -DSVR4 -DSYSV386
  98.  
  99. #    Intel-based SCO Unix
  100. #CFLAGS = -O -DNDEBUG -m486
  101.  
  102. #    IBM RS/6000 cc
  103. CFLAGS = $(INCLUDE) -Iheaders -O $(DEBUGFLAG) $(PROFLAG) $(PROTOFLAG)
  104.  
  105.  
  106. #########################################################################
  107. # LIBRARIES # same for most machines; may need to add stuff for sockets #
  108. #########################################################################
  109. #    this works for most machines
  110. LIBS = -lpnm -lppm -lpgm -lpbm -lm
  111.  
  112. #    Intel-based SVR4.0
  113. #LIBS = -lpnm -lppm -lpgm -lpbm -lm -lsocket -lnsl -lgen
  114.  
  115. #    Intel-based SCO Unix
  116. #LIBS = -lX11 -lsocket -lmalloc -lPW -lc_s -lm -lppm -lpnm -lpgm -lpbm
  117.  
  118.  
  119. ###############
  120. # OTHER STUFF #
  121. ###############
  122. PURIFY =
  123.  
  124. #
  125. # End of configurable options.  Just type make and have fun.
  126. ##############################################################################
  127.  
  128. INCLUDE = -I$(PBMHDRDIR) 
  129.  
  130. MP_BASE_OBJS = mfwddct.o postdct.o huff.o bitio.o mheaders.o
  131. MP_BASE_SRCS = mfwddct.c postdct.c huff.c bitio.c mheaders.c
  132. MP_ENCODE_OBJS = iframe.o pframe.o bframe.o psearch.o bsearch.o block.o
  133. MP_ENCODE_SRCS = iframe.c pframe.c bframe.c psearch.c bsearch.c block.c
  134. MP_OTHER_OBJS = mpeg.o subsample.o param.o rgbtoycc.o \
  135.     readframe.o combine.o jrevdct.o frame.o fsize.o
  136. MP_OTHER_SRCS = mpeg.c subsample.c param.c rgbtoycc.c \
  137.     readframe.c combine.c jrevdct.c frame.c fsize.c
  138. MP_PARALLEL_OBJS = parallel.o
  139. MP_PARALLEL_SRCS = parallel.c
  140. MP_ALL_SRCS = $(MP_BASE_SRCS) $(MP_OTHER_SRCS) $(MP_ENCODE_SRCS) \
  141.           $(MP_PARALLEL_SRCS) main.c
  142. MP_ALL_OBJS = $(MP_BASE_OBJS) $(MP_OTHER_OBJS) $(MP_ENCODE_OBJS) \
  143.           $(MP_PARALLEL_OBJS) main.o
  144. MP_INCLUDE = mproto.h mtypes.h huff.h bitio.h
  145. MP_MISC = Makefile huff.table parse_huff.pl
  146.  
  147.  
  148. all: $(ANSI2KNR) mpeg_encode
  149.  
  150. #########
  151. # TESTS #
  152. #########
  153.  
  154. test:
  155.     rm -f tmp.stat
  156.     ./mpeg_encode -stat tmp.stat ../test/ts.param
  157.     csh ../test/diffscript tmp.stat ../test/ts.stat /tmp/ts.mpg ../test/ts.mpg
  158.     
  159.  
  160. ############
  161. # BINARIES #
  162. ############
  163.  
  164. mpeg_encode: $(ANSI2KNR) $(MP_ALL_OBJS)
  165.     $(PURIFY) $(CC) $(CFLAGS) -o $@ $(MP_ALL_OBJS) $(LIBDIRS) $(LIBS)
  166.  
  167. profile: $(ANSI2KNR) $(MP_ALL_OBJS)
  168.     $(PURIFY) $(CC) -Bstatic -pg $(CFLAGS) -o $@ $(MP_ALL_OBJS) $(LIBDIRS) $(LIBS)
  169.  
  170. #########
  171. # OTHER #
  172. #########
  173.  
  174. #
  175. # Perl is necessary if you want to modify the Huffman RLE encoding table.
  176. #
  177. PERL = perl
  178.  
  179. # The following stuff is for the Huffman encoding tables.  It's commented-out
  180. # because you probably don't want to change this.  If you do, then uncommment
  181. # it.
  182. #
  183. # huff.h: huff.c
  184. #
  185. # huff.c: parse_huff.pl huff.table
  186. #    $(PERL) parse_huff.pl huff.table
  187.  
  188. headers.o: headers.c
  189.     $(CC) $(CFLAGS) -c headers.c
  190.  
  191. depend: huff.c
  192.     makedepend -- $(CFLAGS) -- $(MP_ALL_SRCS)
  193.  
  194. wc:;        wc -l *.[ch] headers/*.h *.pl *.table
  195. ci:;        ci -l $(MP_ALL_SRCS) $(MP_INCLUDE) $(MP_MISC)
  196. tags: $(MP_ALL_SRCS)
  197.     ctags -t $(MP_ALL_SRCS)
  198.  
  199. new:
  200.     rm -f *.o core *~ gmon.out
  201.     make depend
  202.  
  203. clean:
  204.     rm -f *.o core *~ gmon.out
  205.     make depend
  206.     make tags
  207.     make all
  208.  
  209. #
  210. # WARNING: this assumes you're using GNU indent...
  211. #
  212. indent:;    indent -T FILE -T int8 -T int16 -T int32 -T uint8 -T uint16 -T uint32  -T BitBucket -T MpegFrame -T Block -T FlatBlock $(MP_ALL_SRCS)
  213.  
  214. spotless: clean    
  215.     rm -f huff.c huff.h *.pure.a
  216.     cd pbmplus; make clean
  217.  
  218. ##############################################################################
  219. # DO NOT DELETE THIS LINE -- make depend depends on it.
  220.